<?php 

//function checkObj($user_now,$obj){
$aut = 0;
$msg =  "";
$obj = curPageURL();
$sql = "call selCheckObj('".$user_now."','".$obj."')";
//echo($sql);
$res = $mysqli->query($sql);

	if ($res){
	if ($row = $res->fetch_assoc()){
		$aut = $row['allow'];
		$msg =$row['msg'];
	}	
	$res->close();
	$mysqli->check_result();
	}
	
	if ($aut ==0){
	echo "<script type='text/javascript'>".
		"GEBI('d_title').innerHTML = '&nbsp;&nbsp;&nbsp;Carece de autorizaciones para visualizar esta p&aacute;gina';".
		"alert('".$msg."');".
		"</script>";
	exit;	
	}
	
//	return $msg;
//}

?>